﻿<%@ Page Language="C#" MasterPageFile="~/Design/MasterPage/MasterPage.master" AutoEventWireup="true" CodeFile="HealthMainForm.aspx.cs" Inherits="App_System_HealthMainForm" Title="主画面" enableEventValidation="false" %>
<%@ Import Namespace="Shpm.App.Input.Bean" %>
<%@ Import Namespace="Shpm.App.Commons.Utils" %>
<%@ Register TagPrefix="shpm" TagName="SystemMenu" Src="~/System/Tag/SystemMenuTag.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script language="javascript" event="onload" for="window">
        redrawCalendarMemo(); 
    </script>
    <script language="javascript">
        function redrawCalendarMemo() {
            var obj = parseCalendar('CalendarMemo');
            redrawCalendar(obj);
        }
    </script>
    <table border="0" width="100%">
        <tr>
        <td width="50%" valign="top">
            <table class="table_border_line" width="100%" height="196">
                <tr>
                    <td colspan="3" align="left" height="1">
                        <table border="0" width="100%" cellpadding="0" cellspacing="0">
                            <tr>
                            <td>
                            <script language="javascript">
                                (new TitleBar('SearchBar', '公告栏')).showBar();
                            </script>
                            </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="3" style="padding-left: 0px; height:142px; line-height:21px; border-top:0px; border-bottom:0px; border-left:1px;border-right:1px; border-style:solid; border-color:#e38689" valign="top">
                        <marquee onmouseout=start() onmouseover=stop() height="140" align="middle" scrollamount="1" scrolldelay="30" direction="up">
                        <table id="tblNotifyMsgBoard" width="400" border="0" cellspacing="0" cellpadding="0">
                        </table>
                        <%--<table width="400" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="80"> 
                              <div align="right"><font size="2">2007-10-01&nbsp;</font></div></td>
                            <td width="320"> 
                              <div align="left"><font size="2">关于上海康桥公共事业投资有限公司正式更名的通知。</font></div></td>
                          </tr>
                          <tr> 
                            <td width="80"> 
                              <div align="right"><font size="2">2007-10-15&nbsp;</font></div></td>
                            <td width="320"> 
                              <div align="left"><font size="2">人事部: 关于刘恩霞等任职的通知。</font></div></td>
                          </tr>
                          <tr> 
                            <td width="80"> 
                              <div align="right"><font size="2">2007-10-20&nbsp;</font></div></td>
                            <td width="320"> 
                              <div align="left"><font size="2">亲和源信息：9月份工程项目进度。</font></div></td>
                          </tr>
                        </table>--%>
                        </marquee>
                    </td>
                </tr>
                <tr>
                    <td style="padding-left: 16px; border-top:0px; border-bottom:1px; border-left:1px;border-right:0px; border-style:solid; border-color:#e38689">
                        <a href="#" onclick="window.open('../Input/NotifyMessageUpdForm.aspx','NotifyMessage','scrollbars,resizable,height=520,width=480')">发送消息... </a>
                    </td>
                    <td style="padding-left: 16px; border-top:0px; border-bottom:1px; border-left:0px;border-right:0px; border-style:solid; border-color:#e38689">
                        <br />
                    </td>
                    <td align="right" style="padding-right: 16px; border-top:0px; border-bottom:1px; border-left:0px;border-right:1px; border-style:solid; border-color:#e38689">
                        <asp:LinkButton runat="server" PostBackUrl="~/App/Input/NotifyMessageSrhForm.aspx">更多...</asp:LinkButton>
                    </td>
                </tr>
            </table>
        </td>

        
        <td valign="top">
            <table class="table_border_line" width="100%" height="196">
                <tr>
                    <td colspan="3" align="left">
                        <table border="0" width="100%" cellpadding="0" cellspacing="0">
                            <tr>
                            <td>
                            <script language="javascript">
                                (new TitleBar('SearchBar1', '员工信息')).showBar();
                            </script>
                            </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td width="1" valign="top" style="border-top:0px; border-bottom:1px; border-left:1px;border-right:0px; border-style:solid; border-color:#e38689"><img src="../Input/PersonPhoto.aspx?ID=<%=this.personId %>" width="100" height="133" /></td>
                    <td valign="top" width="100%" style="padding-left: 16px; line-height:21px; border-top:0px; border-bottom:1px; border-left:0px;border-right:0px; border-style:solid; border-color:#e38689">
                        工号: <%=this.employeeId %> <br />
                        姓名: <%=this.employeeName %> <br />
                        职务: <%=this.employeeJob %> <br />                        
                    </td>
                    <td valign="center" style="border-top:0px; border-bottom:1px; border-left:0px;border-right:1px; border-style:solid; border-color:#e38689">
                    <div id="calendar" name="calendar"></div>
                    <script language="javascript"  src="../../javascript/calendar.js" type="text/javascript">
                    </script>
                    <script language="javascript"   type="text/javascript" src="../../javascript/Memo.js">
                    </script>
                    <script language="javascript"   type="text/javascript">
	                    var cal = new Calendar('CalendarMemo', document.getElementById('calendar'), new Date());
	                    cal.setObjectEvent(CALENDAR_CHANGE_MONTH,OnChangeMonth);
	                    cal.setObjectEvent(CALENDAR_CLICK_DATE,OnClickDate);
	                    cal.setObjectEvent(CALENDAR_CLICK_HEADER,OnClickHeader);
	                    cal.setObjectEvent(CALENDAR_CLICK_WEEK,OnClickWeek);
                    </script>
                    </td>
                </tr>
            </table>
        </td>
        </tr>
    </table>
    
    <table width="100%">
    <tr>
    <td style="width:50%" valign="top">
        <table class="table_border_line" width="100%" height="194">
            <tr>
                <td colspan="2" align="left">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                        <td>
                            <script language="javascript">
                                (new TitleBar('SearchBar2', '管家职责')).showBar();
                            </script>
                        </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
            <td style="line-height:21px; border-top:0px; border-bottom:1px; border-left:1px;border-right:2px; border-style:solid; border-color:#e38689">
            <table width="100%" height="100%" border="0">
            <tr>
            <td style="text-align:center; width:40%;" class="GridView_head_grayblue">
                工作安排
            </td>
            <td style="text-align:center; width:30%;" class="GridView_head_grayblue">
                任务信息
            </td>
            <td style="text-align:center; width:30%;" class="GridView_head_grayblue">
                工作总结
            </td>
            </tr>
            <tr>
            <td style="text-align:left; width:40%;">
            <div style="width:100%; height:214px; overflow:auto">
                <table style="width:100%; height:100%;">
                    <tr>
                        <td valign="top">
                            <shpm:SystemMenu runat="server" Text="■职位信息" PostBackUrl="~/App/Input/PersonJobSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■职员信息" PostBackUrl="~/App/Input/PersonEmployeeSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu ID="SystemMenu1" runat="server" Text="■家访管理" PostBackUrl="~/App/Input/HealthVisitPlanSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■康复理疗管理" PostBackUrl="~/App/Input/HealthTherapySrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■用药管理" PostBackUrl="~/App/Input/HealthMedicineSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■主管医生职责" PostBackUrl="~/App/Input/HealthAssignSrh.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■工作量统计" PostBackUrl="~/App/Search/HealthWorkStat.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■健康档案查询" PostBackUrl="~/App/Search/HealthArchivesSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■入住确认" PostBackUrl="~/App/Input/CheckInTaskForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■工作模板维护" PostBackUrl="~/App/Master/WorkTemplateSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■工作模板分配" PostBackUrl="~/App/Input/DutySchemaSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■排班计划分配" PostBackUrl="~/App/Master/DutyScheduleSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■工作计划执行" PostBackUrl="~/App/Input/DutyInfoUpdForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■工作任务查询" PostBackUrl="~/App/Search/DutyPerformSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■生活模型设置" PostBackUrl="~/App/Master/LivingMasterForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■生活管家分配" PostBackUrl="~/App/Input/HappyChamberlaineSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■特殊任务分配" PostBackUrl="~/App/Input/SpecialSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■用户权限分配" PostBackUrl="~/App/System/Mst/SysUserMaintenance.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■部门权限分配" PostBackUrl="~/App/System/Mst/GroupMaintenance.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■快乐活动信息" PostBackUrl="~/App/Input/HappyPlanSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■会员兴趣信息" PostBackUrl="~/App/Input/HappyClubInterestSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■亲和俱乐部信息" PostBackUrl="~/App/Input/HappyClubSrhForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■物资审批" PostBackUrl="~/App/Input/MaterialApproveForm.aspx" LineBreak="True" />
                            <shpm:SystemMenu runat="server" Text="■物资管理" PostBackUrl="~/App/Master/MaterialUpdForm.aspx" LineBreak="True" />
                           <shpm:SystemMenu  runat="server" Text="■订餐" PostBackUrl="~/App/Input/FoodOrdersSrhForm.aspx" LineBreak="True" />
 
                            <% /*
                            <asp:LinkButton ID="LinkButton1" runat="server" Text="■家访管理" PostBackUrl="~/App/Input/HealthVisitPlanSrhForm.aspx" /><br />
                            <asp:LinkButton ID="lnkButton4" runat="server" Text="■职位信息" PostBackUrl="~/App/Input/PersonJobSrhForm.aspx" /><br />
                            <asp:LinkButton ID="lnkButton5" runat="server" Text="■职员信息" PostBackUrl="~/App/Input/PersonEmployeeSrhForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton2" runat="server" Text="■康复理疗管理" PostBackUrl="~/App/Input/HealthTherapySrhForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton3" runat="server" Text="■用药管理" PostBackUrl="~/App/Input/HealthMedicineSrhForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton4" runat="server" Text="■主管医生职责" PostBackUrl="~/App/Input/HealthAssignSrh.aspx" /><br />
                            <asp:LinkButton ID="LinkButton5" runat="server" Text="■工作量统计" PostBackUrl="~/App/Search/HealthWorkStat.aspx" /><br />
                            <asp:LinkButton ID="LinkButton6" runat="server" Text="■健康档案查询" PostBackUrl="~/App/Search/HealthArchivesSrhForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton7" runat="server" Text="■入住确认" PostBackUrl="~/App/Input/CheckInTaskForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton8" runat="server" Text="■工作计划安排" PostBackUrl="~/App/Master/WorkTemplateSrhForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton9" runat="server" Text="■工作计划分配" PostBackUrl="~/App/Input/DutySchemaSrhForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton10" runat="server" Text="■值班计划分配" PostBackUrl="~/App/Master/DutyScheduleSrhForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton12" runat="server" Text="■工作计划执行" PostBackUrl="~/App/Input/DutyInfoUpdForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton17" runat="server" Text="■工作任务查询" PostBackUrl="~/App/Search/DutyPerformSrhForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton13" runat="server" Text="■生活模型设置" PostBackUrl="~/App/Master/LivingMasterForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton16" runat="server" Text="■生活管家设置" PostBackUrl="~/App/Input/HappyChamberlaineSrhForm.aspx" /><br />
                            <asp:LinkButton ID="LinkButton11" runat="server" Text="■特殊任务分配" PostBackUrl="~/App/Input/SpecialSrhForm.aspx" /><br />
                            */ %>
                        </td>
                    </tr>
                </table>
            </div>
            </td>
            <td style="text-align:left; width:30%;">
            <div style="width:100%; height:214px; overflow:auto">
            <table style="width:100%; height:100%;">
            <tr>
            <td class="" id="Td1" runat="server" style="vertical-align:top">
                <asp:Table  ID="TblItem" runat="server" EnableViewState="true">
                    
                </asp:Table>
            </td>
            </tr>
            </table>
            </div>
            </td>
            <td style="text-align:left; width:30%;">
            <div style="width:100%; height:214px; overflow:auto">
            <table style="width:100%; height:100%;">
            <tr>
            <td class="" id="Td2" runat="server" style="vertical-align:top">
                <asp:Table  ID="TblItem2" runat="server" EnableViewState="true">
                    
                </asp:Table>
            </td>
            </tr>
            </table>
            </div>
            </td>
            </tr>
            </table>
            </td>

            </tr>  
            
        </table>
    </td>
    <td style="" valign="top" height="194">
        <table class="table_border_line" width="100%">
                <tr>
                    <td colspan="3" align="left">
                            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                <tr>
                                <td>
                                    <script language="javascript">
                                        (new TitleBar('SearchBar3', '个人消息')).showBar();
                                    </script>
                                </td>
                                </tr>
                            </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="3" style="padding-left: 16px; height:226px; line-height:21px; border-top:0px; border-bottom:0px; border-left:1px;border-right:1px; border-style:solid; border-color:#e38689" valign="top">
                        <div id="msgBoard" style="font-family: 宋体">
                            <table id="tblMsgBoard">                            
                            </table>
                        </div></td>
                </tr>
                <tr style="font-family: 宋体">
                    <td style="padding-left: 16px; border-top:0px; border-bottom:1px; border-left:1px;border-right:0px; border-style:solid; border-color:#e38689">
                        <asp:LinkButton ID="LinkButton14" runat="server" Text="物资申领" PostBackUrl="~/App/Master/MaterialRequisitionForm.aspx" />｜                        
                        <asp:LinkButton ID="LinkButton2" runat="server" Text="请假单信息" PostBackUrl="~/App/Input/PersonLeaveSrhForm.aspx" />｜
                        <a href="#" onclick="window.open('../Input/MessageUpdForm.aspx','PrivateMessage','scrollbars,resizable,height=550px,width=550px')">发送消息... </a>
                    </td>
                    <td style="border-top:0px; border-bottom:1px; border-left:0px;border-right:0px; border-style:solid; border-color:#e38689">
                        <br />
                    </td>
                    <td align="right" style="padding-right: 16px; border-top:0px; border-bottom:1px; border-left:0px;border-right:1px; border-style:solid; border-color:#e38689">
                        <asp:LinkButton ID="LinkButton1" runat="server" Text="更多..." PostBackUrl="~/App/Input/MessageSrhForm.aspx" />
                    </td>
                </tr>
            </table>    
    </td>
    </tr>
    </table>
    
    <table width="100%" border="0">
        <tr>
            <td width="100%" valign="top">
                <table class="table_border_line" border="0" width="100%">
                    <tr>
                        <td align="left" colspan="7">
                            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                                <tr>
                                <td>
                                    <script language="javascript">
                                        (new TitleBar('SearchBar4', '会员动态')).showBar();
                                    </script>
                                </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
                            <HeaderTemplate>
                                    <tr>
                                        <td class="TD_headrow_style">会员编号</td>
                                        <td class="TD_headrow_style">会员姓名</td>
                                        <td class="TD_headrow_style">房间编号</td>
                                        <td class="TD_headrow_style">生活模型</td>

                                    </tr>
                            </HeaderTemplate>

                            <ItemTemplate>
                                    <tr>
                                        <td class="TD_row_style" style="background-color:#ffffff"><a href="#" onclick="openPersonDetails('<%# ((HealthAssignBean)Container.DataItem).MemberNo%>')"><%# ((HealthAssignBean)Container.DataItem).MemberNo%></a></td>
                                        <td class="TD_row_style" style="background-color:#ffffff"><%# ((HealthAssignBean)Container.DataItem).Name%></td>
                                        <td class="TD_row_style" style="background-color:#ffffff"><%# ((HealthAssignBean)Container.DataItem).ApartmentNo%></td>
                                       
                                        <td class="TD_row_style" style="background-color:#ffffff">
                                        <asp:LinkButton ID="Step0" runat="server" CommandName="Step0" OnCommand="LinkButton_Command" CommandArgument="<%# ((HealthAssignBean)Container.DataItem).MemberNo%>" Text="生活模型" Enabled = "true" ></asp:LinkButton>
                                     
                                        </td>
                                    </tr>
                            </ItemTemplate>

                            <FooterTemplate>
                                    <tr>
                                        <td colspan="4" align="right">
                                  
                                          
                                          </td>
                                    </tr>
                            </FooterTemplate>
                        </asp:Repeater>
                        
                        <asp:Repeater ID="Repeater2" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
                            <HeaderTemplate>
                                    <tr>
                                        <td class="TD_headrow_style">会员编号</td>
                                        <td class="TD_headrow_style">会员姓名</td>
                                        <td class="TD_headrow_style">房间编号</td>
                                        <td class="TD_headrow_style">生活模型</td>

                                    </tr>
                            </HeaderTemplate>

                            <ItemTemplate>
                                    <tr>
                                        <td class="TD_row_style" style="background-color:#ffffff"><a href="#" onclick="openPersonDetails('<%# ((HappyChamberlaineBean)Container.DataItem).MemberNo%>')"><%# ((HappyChamberlaineBean)Container.DataItem).MemberNo%></a></td>
                                        <td class="TD_row_style" style="background-color:#ffffff"><%# ((HappyChamberlaineBean)Container.DataItem).Name%></td>
                                        <td class="TD_row_style" style="background-color:#ffffff"><%# ((HappyChamberlaineBean)Container.DataItem).ApartmentNo%></td>
                                       
                                        <td class="TD_row_style" style="background-color:#ffffff">
                                        <asp:LinkButton ID="Step0" runat="server" CommandName="Step0" OnCommand="LinkButton_Command" CommandArgument="<%# ((HappyChamberlaineBean)Container.DataItem).MemberNo%>" Text="生活模型" Enabled = "true" ></asp:LinkButton>
                                     
                                        </td>
                                    </tr>
                            </ItemTemplate>

                            <FooterTemplate>
                                    <tr>
                                        <td colspan="4" align="right">
                                  
                                          
                                          </td>
                                    </tr>
                            </FooterTemplate>
                        </asp:Repeater>
                        <!-- table width="90%" border="1" class="table_border_line">
                            <tr>
                                <td class="list_data_bg">员工编号</td>
                                <td class="list_data_bg">联系人</td>
                                <td class="list_data_bg">意向程度</td>
                                <td class="list_data_bg">销售状态</td>
                                <td class="list_data_bg">回访时间</td>
                            </tr>
                            <tr>
                                <td>6102</td>
                                <td>XXX</td>
                                <td>★★★★★</td>
                                <td>合同签订</td>
                                <td>2007/01/01</td>
                            </tr>
                            <tr>
                                <td>6102</td>
                                <td>XXX</td>
                                <td>★★★★★</td>
                                <td>合同签订</td>
                                <td>2007/01/01</td>
                            </tr>
                            <tr>
                                <td>6102</td>
                                <td>XXX</td>
                                <td>★★★★★</td>
                                <td>合同签订</td>
                                <td>2007/01/01</td>
                            </tr>
                            <tr>
                                <td colspan="5" align="right">更多...</td>
                            </tr>
                        </table -->
                        </td>
                    </tr>
                </table>                
            </td>

            <!-- td colspan="2" valign="top">               
                <table class="table_border_line">
                    <tr>
                        <td align="left" class="list_title_blue_bg">&nbsp;考勤记录</td>
                    </tr>
                    <tr>
                        <td>
                        <table width="90%" border="1" class="table_border_line">
                            <tr>
                                <td class="TD_headrow_style" height="25">员工编号</td>
                                <td class="TD_headrow_style">员工姓名</td>
                                <td class="TD_headrow_style">出勤时间</td>
                                <td class="TD_headrow_style">退席时间</td>
                            </tr>
                            <tr>
                                <td height="16" class="TD_row_style">6102</td>
                                <td class="TD_row_style">XXX</td>
                                <td class="TD_row_style">09:00</td>
                                <td class="TD_row_style">17:00</td>
                            </tr>
                            <tr>
                                <td height="16" class="TD_row_style">6104</td>
                                <td style="height: 18px" class="TD_row_style">XXX</td>
                                <td style="height: 18px" class="TD_row_style">09:00</td>
                                <td style="height: 18px" class="TD_row_style"> -- </td>
                            </tr>
                            <tr>
                                <td height="16" class="TD_row_style">6104</td>
                                <td class="TD_row_style">XXX</td>
                                <td class="TD_row_style"> -- </td>
                                <td class="TD_row_style"> -- </td>
                            </tr>
                            <tr>
                                <td colspan="4" align="right" class="TD_row_style">更多...</td>
                            </tr>
                        </table>
                        </td>
                    </tr>
                </table>
            </td -->
        </tr>
        <tr>
            <td valign="top" width="100%" style="text-align:right;"><asp:LinkButton ID="LinkButton3" runat="server" Text="更多..." PostBackUrl="~/App/Input/MemberHaveForm.aspx" /></td>
        </tr>
    </table>
    
    <script language="javascript" type="text/javascript">
        // set time frequency to get new message from sever
        function getNotifyMessage() {
            var e;            
            try {
                CommonAjaxUtils.GetNotifyMessage('<%=this.employeeId %>', '<%=this.userId %>',bindCallBackResult_NotifyMessage);
		    }
            catch(e) {
                alert(e.message);
            }
        }
                
        function bindCallBackResult_NotifyMessage(response) {    
            try {                                            
                setTimeout("getNotifyMessage()", <%=refreshMsgMSeconds %>);            
                                          
                var targetData = response.value;               		    		        		        		        
	            var msgTable;
	            msgTable = document.getElementById("tblNotifyMsgBoard");
    	        
    	        // refresh work area message board
	            if (msgTable != null && typeof(msgTable) == "object"){
                    bindMsgTable(msgTable,targetData);
	            }
	        }
            catch(e) {
                alert(e.message);
            }
        }
        
        // bind message table data
        function bindMsgTable(objTable,objData) { 
            if (objData == null) { return; }
                  									
		    // del rows                        
		    for(var i=objTable.rows.length - 1; i >= 0; i--) {				
			    objTable.deleteRow(i);				
		    }
		    
		    // readd rows
		    var maxDispCnt = objData.length > <%=msgMaxDispCount %> ? <%=msgMaxDispCount %> : objData.length;
            for(var i = 0; i < maxDispCnt; i++) {                      
                var id = objData[i].MessageId;                
                var sendDate = objData[i].SendDate.format(GLOBAL_CALENDAR_DATE_FORMAT);
                var title = objData[i].Subject;
                var origin = objData[i].DepartName;
                var status = objData[i].MessageStatus;
                if (title == null) {
                    title = "(无主题)";
                }
                
                var elementRow = objTable.insertRow(objTable.rows.length);
		        elementRow.id = "msgRow" + i;
		        
                var elementCol = elementRow.insertCell(elementRow.cells.length);
                elementCol.align = "left";
                elementCol.className = "TD_row_style_message"; 
                if (status == "1") {
                    elementCol.className = "TD_row_style_new_message";                
                }
                //elementCol.innerHTML = "<A href=\"" + strCmd + "\" >" + name +"</A>";
                var elementLink = top.window.mainFrame.document.createElement("A");
                elementLink.setAttribute("id", "msgLink" + i);                
                elementLink.setAttribute("href", "javascript:top.window.topFrame.getNewMessage();window.open('../Input/MessageReadForm.aspx?MESSAGE_ID=" + id +"','_blank','scrollbars,resizable,height=550,width=520');void(0);");
                elementLink.setAttribute("innerText", "      " + sendDate + "  " + origin + "：" + title); 
                //elementLink.setAttribute("style", "color:red");
                elementCol.appendChild(elementLink);
            }
        }               
    </script>
</asp:Content>

